﻿Imports System.Net
Imports System.IO
Imports System.Runtime.Serialization

Public Class ProductoDAL
    Public Function ListaProducto(ByVal dni As String) As DataTable

        Dim result As New DataTable()
        Dim ds As New DataSet

        'Dim ws As New wsProducto.WSProducto()
        'Return ws.ListaProducto(dni)


        Dim proxy As New WebClient()
        Dim abc As Byte() = proxy.DownloadData(New Uri("http://localhost:1805/Productos/25854703"))
        Dim strm = New MemoryStream(abc)
        ds.ReadXml(strm)

        'Dim obj As New DataContractSerializer(GetType(String))
        'Dim result As String = obj.ReadObject(strm).ToString()

        Return ds.Tables(0)
    End Function
End Class
